package com.up.selfshop.controller;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.up.selfshop.res.Res;
import com.up.selfshop.res.ResDoor;

/**
 * 
 * @author liuzy
 * @since 2016年8月30日
 */
@Controller
@RequestMapping("/")
public class IndexController extends BaseController {
	private Logger logger = Logger.getLogger(IndexController.class);

	@RequestMapping("/")
	public String index() {
		logger.info("index");
		return "index.html";
	}
	// 验证（二维码页面）
	@RequestMapping(value = "/box")
	public String login( //
			@RequestParam String box_id, //
			@RequestParam String appid, //
			@RequestParam String appkey) {
		return "box.html";
	}
	// 开门请求
	@RequestMapping(value = "/open_door_by_order", method = RequestMethod.POST)
	@ResponseBody
	public Res open_door_by_order( //
			@RequestParam String user_id, //
			@RequestParam String user_info, //
			@RequestParam String box_id, //
			@RequestParam String order_id, //
			@RequestParam String nonce, //
			@RequestParam String sign) {
		ResDoor res = new ResDoor();
		return res;
	}
	// 支付回调
	@RequestMapping(value = "/pay_callback", method = RequestMethod.POST)
	@ResponseBody
	public Res order_callback( //
			@RequestParam String user_id, //
			@RequestParam String order_id, //
			@RequestParam String pay_stat, //
			@RequestParam String nonce, //
			@RequestParam String sign) {
		Res res = new Res();
		return res;
	}
	// 订单详情
	@RequestMapping(value = "/order_detail", method = RequestMethod.POST)
	@ResponseBody
	public Res order_detail( //
			@RequestParam String order_id, //
			@RequestParam String nonce, //
			@RequestParam String sign) {
		Res res = new Res();
		return res;
	}
}
